/*
 * Copyright (C) 2007 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.mobdev.notepad;

import android.content.Intent;
import android.net.Uri;
import android.widget.EditText;

import com.mobdev.notepad.shared.ui.AbstractNoteEditor;
import com.mobdev.notepad.sync.SyncActivity;

/**
 * A generic activity for editing a note in a database.  This can be used
 * either to simply view a note {@link Intent#ACTION_VIEW}, view and edit a note
 * {@link Intent#ACTION_EDIT}, or create a new note {@link Intent#ACTION_INSERT}.
 */
public class NoteEditor extends AbstractNoteEditor {


	@Override
	protected void init() {
		// Set the layout for this activity.  You can find it in res/layout/note_editor.xml
        setContentView(R.layout.note_editor);


        // The text view for our note, identified by its ID in the XML file.
        mText = (EditText) findViewById(R.id.note);

	}


	@Override
	protected int getSyncMenuIconId()
	{
		return R.drawable.sync_48;
	}

	@Override
	protected void doEditTitle(Uri mUri)
	{
		startActivity(new Intent(this, TitleEditor.class).setData(mUri));
	}

	@Override
	protected void doSync()
	{
		// Launch activity to sync notes with helipad
		startActivity(new Intent(this, SyncActivity.class));
	}

}
